{% extends "base.html" %}

{% block title %} Bayanihan: Reports {% endblock %}

{% block nav-reports %} class="nav-active" {% endblock %} 

{% block css %} 
	<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/reports.css" />
    <style>
    </style>
{% endblock %}

{% block js %} 
    <script src="/_utils/script/jquery.couch.js"></script>
{% endblock %}

{% block content %}
    <div id="sidebar">
        {% if deployments %}
            {% for parent, children in deployments.items %}
                <h3><strong> {{ parent }}</strong></h3>
                <div class="child_list">
                {% for child in children %}
                    {% if deployment_id == child %}
                        <h3 class="selected">
                    {% else %}
                        <h3>
                    {% endif %}
                            <a href="/deployments/{{child}}/">{{ child }}</a>
                        </h3>
                {% endfor %}
                </div>
            {% endfor %}
        {% else %}
            <p>No deployments are available.</p>
        {% endif %}
    </div>
    <div id='report_wrapper'>
        {% if reports %}
            {% for x in reports %}
                <div class='report'>
                    <h3><a href="/reports/{{x.key}}/">{{x.value.properties.title}}</a></h3>
                    <div class="timestamp">{{ x.value.properties.timestamp_submitted }}</div>
                    <div style="clear:left"></div>
                    <div class='desc'>{{ x.value.properties.description }}</div>
                </div>
            {% endfor %}
        {% else %}
            <p>No reports are available.</p>
        {% endif %}
    </div>
    <div style="clear:left"></div>
{% endblock %}